import base from "./base";
import axios from "@/utils/request";

const api = {
  // 登录
  login(params) {
    return axios.post(base.login, params);
  },
  //计算
  calculate(query) {
    return axios.put(base.calculate, params);
  },
  ////查询教师总数
  getTeacherTotal() {
    return axios.get(base.getTeacherTotal);
  },
  //分页查询教师信息
  getTeacher(params) {
    return axios.get(base.getTeacher, { params });
  },
  //添加教师信息
  addTeacher(params) {
    return axios.post(base.addTeacher, params);
  },
  //修改教师信息
  changeTeacher(params) {
    return axios.put(base.changeTeacher, params);
  },
  //删除教师信息
  deleteTeacher(params) {
    return axios.delete(base.deleteTeacher, { data: params });
  },
  //导入excel
  importExcel(params) {
    return axios.post(base.importExcel, params, {
      headers: { "Content-Type": "multipart/form-data" },
    });
  },
  //导出excel
  exportExcel() {
    return axios.get(base.exportExcel, {
      responseType: "blob", // 关键：指定响应类型为二进制流
    });
  },
  //查询所有学校教学人员学时参考
  getSchTea() {
    return axios.get(base.getSchTea);
  },
  //修改所有学校教学人员学时参考
  changeSchTea(params) {
    return axios.get(base.changeSchTea, { params });
  },
  //查询所有学校实验员学时参考
  getSchLab() {
    return axios.get(base.getSchLab);
  },
  //查询所有学院教学人员学时参考
  getColTea() {
    return axios.get(base.getColTea);
  },
  //查询所有学院实验员学时参考
  getColLab() {
    return axios.get(base.getColLab);
  },
  //查询教学人员标准分值
  getTeaStandard() {
    return axios.get(base.getTeaStandard);
  },
  //查询工勤岗标准分值
  getWorkStandard() {
    return axios.get(base.getWorkStandard);
  },
  //查询实验岗标准分值
  getOtherStandard() {
    return axios.get(base.getOtherStandard);
  },
  //查询管理岗标准分值
  getManStandard() {
    return axios.get(base.getManStandard);
  },
};

export default api;
